package thread.basic;

/*

yield 礼让线程  开发基本不用（了解）
 */
public class Demo07_Yield {
    public static void main(String[] args) {
        new MyThread1().start();
        new MyThread1().start();

    }
}

class MyThread1 extends Thread {
    @Override
    public void run() {
        for (int i = 1; i < 1000; i++) {
            if (i % 10 == 0) {
                Thread.yield();//让出cpu
            }
            System.out.println(getName()+"..........." + i);
        }
    }
}
